package com.zfx.pojo;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Map;

/**
 * @description:  通讯录实体类
 * @author: zfx
 */
@Table(name = "tbs_tongxunlu")
@Data
public class Address implements Serializable {

    private static final long serialVersionUID = 1L;

    public Address(){}

    public Address(Map<String, Object> dataMap) {
        nickName = dataMap.get("nickName") == null ? null : '%'+String.valueOf(dataMap.get("nickName"))+'%';
        remarks = dataMap.get("remarks") == null ? null : '%'+String.valueOf(dataMap.get("remarks"))+'%';
        phone = dataMap.get("phone") == null ? null : '%'+String.valueOf(dataMap.get("phone"))+'%';
    }

    @Id
    @Column(name = "userId")
    private Integer userId;

    @Id
    @Column(name = "haoyouId")
    private Integer haoyouId;

    @Column(name = "remarks")
    private String remarks;

    @Column(name = "nickName")
    private String nickName;

    @Column(name = "phone")
    private String phone;

    @Column(name = "permission")
    private String permission;
}
